package com.queming.service;

import com.queming.core.dto.UserCreateDto;
import com.queming.service.user.UserService;
import org.junit.jupiter.api.BeforeEach;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

/**
 * @author chencidiao
 * @date 2022/05/06 17:49
 **/
@SpringBootTest
public abstract class BaseService {

    @Autowired
    UserService userService;

    /**
     *
     * @author 陈词调
     * @date 2022/5/6
     * 执行测试之前就会把下面这个用户塞进去
     */
    @BeforeEach
    void setDefaultUser(){
        UserCreateDto user = new UserCreateDto();
        user.setUsername("admin");
        user.setPassword("123456");
        userService.create(user);
    }
}
